package net.dfrz.service;

import java.util.List;

import net.dfrz.dao.ManagerDao;
import net.dfrz.dao.ManagerDaoJDBCImpl;
import net.dfrz.domain.Manager;
import net.dfrz.utils.ManagerSearchHelper;
import net.dfrz.utils.Page;



public class ManagerServiceImpl implements ManagerService {
	
	ManagerDao dao = new ManagerDaoJDBCImpl();
	
	public void createManager(Manager manager) {
		
		dao.add(manager);
 
	}

	public void delByName(String name) {
		dao.delByName(name);

	}
 
	public Manager getByName(String name) {
		
		return dao.getByName(name);
	}

	public List<Manager> loadAll() {
		
		return dao.loadAll();
	}

	public void update(Manager manager) {
		dao.update(manager);

	}

	public Manager checkManager(Manager manager) {
		// TODO Auto-generated method stub
		return null;
	}
	public long countByHelper(ManagerSearchHelper managerSearchHelper) {
		
		 
		return dao.countByHelper(managerSearchHelper);
		
	}

	public Page loadScopeManager(ManagerSearchHelper managerSearchHelper, Page page) {
		
		
		page.setPageContent(dao.loadScopeManager(managerSearchHelper, page.getStartIndex(), page.getEndIndex()));
		return page;
		
	}
}
